#include <stdio.h>

void insert(int a[], int i, int n, int temp) {
	if (i == n) {
		a[n] = temp;
		return;
	}
	if (a[i] > temp) {
		a[i] = a[i + 1]; // Make space for temp
		insert(a, i + 1, n, temp); // Recursively move elements to the right
	} else {
		// temp can be inserted at index i
		insert(a, i + 1, n, temp); // Recursively insert temp to the right of current element
		a[i] = temp; // Place temp at its correct position
	}
}

int main() {
	int a[20];
	int n = 0;
	int temp;

	while (scanf("%d", &temp) != EOF) {
		if (temp == -1) {
			break; // Exit loop when -1 is read
		}
		insert(a, 0, n, temp); // Insert temp into the sorted part of the array
		n++; // Increment the size of the sorted part
	}

	// Print the sorted array
	for (int k = 0; k < n - 1; k++) {
		printf("%d ", a[k]);
	}
	printf("%d\n", a[n - 1]);

	return 0;
}